#ifndef _GD25Q_SPI_H_
#define _GD25Q_SPI_H_

#include "stdint.h"
#include "gd25q_cmd.h"

//base interface
void gd25_spi_init(void);
void gd25_cs(uint8_t st);
void w25n_cs(uint8_t st);
void gd25_spi_mode(gd25_spi_type mode);
void gd25_spi_high_speed(void);
void gd25_spi_low_speed(void);

//spi data r/w
uint8_t gd25_spi_rb(void);
void gd25_spi_wb(uint8_t dataW);
uint8_t gd25_spi_cmd_send(uint8_t *dataw, uint8_t Len);
uint8_t gd25_spi_write(uint8_t *dataw, uint32_t Len);
uint8_t gd25_spi_read(uint8_t *datar, uint32_t Len);
uint8_t gd25_security_lock(uint32_t addr);

//qpi data r/w
uint8_t gd25_qpi_write(uint8_t *dataw, uint32_t Len);
uint8_t gd25_qpi_read(uint8_t *datar, uint32_t Len);

#endif /* _GD25Q_SPI_H_ */
